package com.cosc716.restaurant.commands.menu;


import com.cosc716.restaurant.commands.Command;
import com.cosc716.restaurant.domain.MenuItem;
import com.cosc716.restaurant.system.Aggregator;

public class CommandAddMenuItem implements Command {
	
	private MenuItem newItem = null;
	
	public CommandAddMenuItem(MenuItem newItem) {
		this.newItem = newItem;
	}

	@Override
	public Object execute(Aggregator aggregator) {
		
		if(newItem != null) {		    
			aggregator.getMenu().additem(newItem);
			
			return true;
		}
		
		return false;
	}

}
